<div [@routerTransition]>
    <div class="m-subheader ">
        <div class="d-flex align-items-center">
            <div class="mr-auto col-xs-6">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>成本查询</span>
                </h3>
                <span> </span>
            </div>
            <div class="col-xs-6 text-right">
                <!-- <button class="btn btn-primary" (click)="confirmImport()" style="margin-left: 10px;">确认导入</button> -->
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <div class="m-form m-form--label-align-right">
                    <form class="horizontal-form" autocomplete="off">
                        <div class="m-form m-form--label-align-right">
                            <div class="row align-items-center m--margin-bottom-10">
                                <div class="col-xl-12">
                                    <div class="form-group m-form__group align-items-center">
                                        <div class="input-group">
                                            <input
                                                [(ngModel)]="filterText"
                                                name="filterText"
                                                autoFocus
                                                class="form-control m-input"
                                                [placeholder]="l('SearchWithThreeDot')"
                                                type="text"
                                            />
                                            <span class="input-group-btn">
                                                <button (click)="getBatchs()" class="btn btn-primary" type="submit">
                                                    <i class="flaticon-search-1" [attr.aria-label]="l('Search')"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- <div class="row m--margin-bottom-10" [hidden]="!advancedFiltersAreShown"></div>

                            <div class="row margin-bottom-10" *ngIf="advancedFiltersAreShown">
                                <div class="col-sm-12 text-right">
                                    <button class="btn btn-metal" (click)="getBatchs()">
                                        <i class="fa fa-refresh"></i> {{ l("Refresh") }}
                                    </button>
                                </div>
                            </div>
                            <div class="row margin-bottom-10">
                                <div class="col-sm-12">
                                    <span
                                        class="clickable-item text-muted"
                                        *ngIf="!advancedFiltersAreShown"
                                        (click)="advancedFiltersAreShown = !advancedFiltersAreShown"
                                        ><i class="fa fa-angle-down"></i> {{ l("ShowAdvancedFilters") }}</span
                                    >
                                    <span
                                        class="clickable-item text-muted"
                                        *ngIf="advancedFiltersAreShown"
                                        (click)="advancedFiltersAreShown = !advancedFiltersAreShown"
                                        ><i class="fa fa-angle-up"></i> {{ l("HideAdvancedFilters") }}</span
                                    >
                                </div>
                            </div> -->
                        </div>
                    </form>
                </div>
                <div class="row align-items-center">
                    <!--<Primeng-TurboTable-Start>-->
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <p-table
                            #dataTable
                            (onLazyLoad)="getBatchs($event)"
                            [value]="primengTableHelper.records"
                            rows="{{ primengTableHelper.defaultRecordsCountPerPage }}"
                            [paginator]="false"
                            [lazy]="true"
                            [responsive]="primengTableHelper.isResponsive"
                        >
                            <ng-template pTemplate="header">
                                <tr>
                                    <th pSortableColumn="id" width="220px">
                                        条码
                                        <p-sortIcon field="id"></p-sortIcon>
                                    </th>
                                    <th pSortableColumn="taskId" width="120px">
                                            任务号
                                            <p-sortIcon field="task.taskNum"></p-sortIcon>
                                        </th>
                                        <th  pSortableColumn="task.productId" width="120px">
                                                图号
                                            </th>
                                      <th  pSortableColumn="task.productName" width="120px">
                                                产品名称
                                        </th>    
                                   
                                    <th pSortableColumn="parentId" width="120px">
                                        父条码
                                    </th>
                                    <th pSortableColumn="certificate" width="120px">
                                        合格证
                                        <p-sortIcon field="certificate"></p-sortIcon>
                                    </th>
                                    <th pSortableColumn="qcCard" width="120px">
                                        质控卡
                                        <p-sortIcon field="qcCard"></p-sortIcon>
                                    </th>
                                    
                                    <th pSortableColumn="creationTime" width="120px">
                                        {{ l("CreationTime") }}
                                        <p-sortIcon field="creationTime"></p-sortIcon>
                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit">
                                <tr>
                                    <td width="220px">
                                            {{ record.id }}@{{ record.quantity }}
                                        <a
                                            class="btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill"
                                            [href]="
                                                appBaseUrl +
                                                '/#/app/cost-display/cost-query-detail?id=' +
                                                record.id +
                                                '&quantity=' +
                                                record.quantity
                                            "
                                            target="_blank"
                                        >
                                            <i class="la la-search" [attr.aria-label]="l('Search')"></i>
                                        </a>
                                    </td>
                                    <td width="120px">
                                            {{ record.task.taskNum }}
                                        </td>
                                        <td width="120px">
                                                {{ record.task.productId }}
                                            </td>
                                            <td width="120px">
                                                    {{ record.task.productName }}
                                                </td>
                                      
                                    <td width="120px">
                                        {{ record.task.parentId }}
                                    </td>
                                   
                                    <td width="120px">
                                        {{ record.certificate }}
                                    </td>
                                    <td width="120px">
                                        {{ record.qcCard }}
                                    </td>
                                   
                                    <td width="120px">
                                        <span class="ui-column-title">{{ l("CreationTime") }}</span>
                                        {{ record.creationTime | momentFormat: "L" }}
                                    </td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                            {{ l("NoData") }}
                        </div>
                        <div class="primeng-paging-container">
                            <p-paginator
                                rows="{{ primengTableHelper.defaultRecordsCountPerPage }}"
                                #paginator
                                (onPageChange)="getBatchs($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage"
                            >
                            </p-paginator>
                            <span class="total-records-count">
                                {{ l("TotalRecordsCount", primengTableHelper.totalRecordsCount) }}
                            </span>
                        </div>
                    </div>
                    <!--<Primeng-TurboTable-End>-->
                </div>
            </div>
        </div>
    </div>
</div>
